#include <iostream>
#include <vector>
#include <string>
#include <math.h>

using namespace std;

vector<int> num = {9, 9, 8, 7, 6, 5, 4, 3, 2, 1};

int countNumbersWithUniqueDigits(int n) {
    int c = 1;
    if(n == 0) return c;
    for(int i = 1; i <= n; i++){
        int m = 1;
        for(int j = i - 1; j >= 0; j--){
            m *= num[j];
        }
        c += m;
    }
    return c;
}

int main(){
    int n = 5;
    cout << countNumbersWithUniqueDigits(n) << endl;
    return 0;
}
